package com.yilin.tms.core.entity.order.rob;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yilin.tms.core.commons.base.BaseDataEntity;
import com.yilin.tms.core.commons.annotation.Explain;
import com.yilin.tms.core.entity.order.goods.GoodsOrderNoteDetail;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;

/**
 * 抢单货物节点
 *
 * @author zhangjinyuan
 * @date 2022/10/28
 */
@Entity
@Table(name = "rob_order_note_detail")
@TableName(value = "rob_order_note_detail")
public class RobOrderNoteDetail extends BaseDataEntity {


    @Column(name = "goods_order_id")
    private String goodsOrderId; //原货源 ID
    @Column(name = "rob_order_id")
    private String robOrderId; //抢单ID
    @Column(name = "rob_order_note_id")
    private String robOrderNoteId;//原节点ID
    @Column(name = "goods_note_detail_id")
    private String goodsNoteDetailId;//原货物 ID
    /**
     * 货物基本数据
     */
    @Explain("类型名称")
    @Column(name = "goods_type_name")
    private String goodsTypeName;
    @Explain("货物名称")
    @Column(name = "goods_name")
    private String goodsName;
    @Explain("货物描述")
    @Column(name = "goods_describe")
    private String goodsDescribe;
    /**
     * 抢单货物量
     */
    @Column(name = "rob_measure")
    private Double robMeasure; //抢单量
    @Column(name = "rob_gross_weight")
    private Double robGrossWeight;//毛重 T 根据抢单比计算
    @Column(name = "rob_unit_price")
    private Double robUnitPrice; //抢单单价，单价计价有效
    @Column(name = "rob_transport_cost")
    private Double robTransportCost;  //抢单运输费
    @Column(name = "measure_unit")
    private String measureUnit;  //单位 车，吨，千克，方，件，箱 ...
    @Column(name = "cargo_unit_price")
    private Double cargoUnitPrice;
    @Column(name = "cargo_threshold")
    private Double cargoThreshold;
    /**
     * 查询字段
     */
    @Transient
    @TableField(exist = false)
    private boolean split;//是否拆分
    @Transient
    @TableField(exist = false)
    private int splitCount;//拆分数量
    @Transient
    @TableField(exist = false)
    private String truckId;//拆分预分配车辆
    @Transient
    @TableField(exist = false)
    private GoodsOrderNoteDetail goodsOrderNoteDetail; //原始货物
    @Transient
    @TableField(exist = false)
    private List<RobOrderNoteDetail> splitNoteDetailList = new ArrayList<>();//生成拆分货物

    public Double getCargoUnitPrice() {
        return cargoUnitPrice;
    }

    public void setCargoUnitPrice(Double cargoUnitPrice) {
        this.cargoUnitPrice = cargoUnitPrice;
    }

    public Double getCargoThreshold() {
        return cargoThreshold;
    }

    public void setCargoThreshold(Double cargoThreshold) {
        this.cargoThreshold = cargoThreshold;
    }

    public String getGoodsTypeName() {
        return goodsTypeName;
    }

    public void setGoodsTypeName(String goodsTypeName) {
        this.goodsTypeName = goodsTypeName;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getGoodsDescribe() {
        return goodsDescribe;
    }

    public void setGoodsDescribe(String goodsDescribe) {
        this.goodsDescribe = goodsDescribe;
    }

    public String getGoodsOrderId() {
        return goodsOrderId;
    }

    public void setGoodsOrderId(String goodsOrderId) {
        this.goodsOrderId = goodsOrderId;
    }

    public String getRobOrderId() {
        return robOrderId;
    }

    public void setRobOrderId(String robOrderId) {
        this.robOrderId = robOrderId;
    }

    public String getRobOrderNoteId() {
        return robOrderNoteId;
    }

    public void setRobOrderNoteId(String robOrderNoteId) {
        this.robOrderNoteId = robOrderNoteId;
    }

    public String getGoodsNoteDetailId() {
        return goodsNoteDetailId;
    }

    public void setGoodsNoteDetailId(String goodsNoteDetailId) {
        this.goodsNoteDetailId = goodsNoteDetailId;
    }

    public Double getRobMeasure() {
        return robMeasure;
    }

    public void setRobMeasure(Double robMeasure) {
        this.robMeasure = robMeasure;
    }

    public Double getRobGrossWeight() {
        return robGrossWeight;
    }

    public void setRobGrossWeight(Double robGrossWeight) {
        this.robGrossWeight = robGrossWeight;
    }

    public Double getRobUnitPrice() {
        return robUnitPrice;
    }

    public void setRobUnitPrice(Double robUnitPrice) {
        this.robUnitPrice = robUnitPrice;
    }

    public Double getRobTransportCost() {
        return robTransportCost;
    }

    public void setRobTransportCost(Double robTransportCost) {
        this.robTransportCost = robTransportCost;
    }

    public String getMeasureUnit() {
        return measureUnit;
    }

    public void setMeasureUnit(String measureUnit) {
        this.measureUnit = measureUnit;
    }

    public boolean isSplit() {
        return split;
    }

    public void setSplit(boolean split) {
        this.split = split;
    }

    public int getSplitCount() {
        return splitCount;
    }

    public void setSplitCount(int splitCount) {
        this.splitCount = splitCount;
    }

    public String getTruckId() {
        return truckId;
    }

    public void setTruckId(String truckId) {
        this.truckId = truckId;
    }

    public GoodsOrderNoteDetail getGoodsOrderNoteDetail() {
        return goodsOrderNoteDetail;
    }

    public void setGoodsOrderNoteDetail(GoodsOrderNoteDetail goodsOrderNoteDetail) {
        this.goodsOrderNoteDetail = goodsOrderNoteDetail;
    }

    public List<RobOrderNoteDetail> getSplitNoteDetailList() {
        return splitNoteDetailList;
    }

    public void setSplitNoteDetailList(List<RobOrderNoteDetail> splitNoteDetailList) {
        this.splitNoteDetailList = splitNoteDetailList;
    }
}
